/******************************************************************************************
 * Import
 ******************************************************************************************/

// module
import Taro, { Component } from '@tarojs/taro'

// project
import { CPage, CContent, CHeader, CFooter, CFloat, CAround, CBetween, CCenter, CColumn, CRow, CWrap, CLine, CHand, CItemX, CItemY, CText, CLabel, CSvg, CImage, CButton } from '../../library/comp';
import { Base64, Gen, Time, Zip, Session, Storage, Toast, Loading, Modal, ActionSheet, Http } from '../../library/func';
import Icon from '../../project/style/icon';

import '../../assets/error.png';

/******************************************************************************************
 * Export Class
 ******************************************************************************************/

export default class Index extends Component {
	
	/*------------------------------------------------------------------------------------
	 * 初始化
	 *-----------------------------------------------------------------------------------*/
	constructor(props) {
		super(props);

		/**
		 * state
		 */
		this.state = {
			background: '#f60',
			status: 'success'
		}
	}

	
	/*------------------------------------------------------------------------------------
	 * 事件处理
	 *-----------------------------------------------------------------------------------*/

	// onImageClick
	onImageClick = (param, e)=> {
		console.log('图片被点击，参数为：' + param)
	}

	// onImageLangPress
	onImageLangPress = (param, e)=> {
		console.log('图片被长按，参数为：' + param)
	}

	/*------------------------------------------------------------------------------------
	 * 自定义方法
	 *-----------------------------------------------------------------------------------*/

	/*------------------------------------------------------------------------------------
	 * 渲染
	 *-----------------------------------------------------------------------------------*/
	render () {
		return (
			<CPage>
				<CContent>
					<CImage src='/assets/error.png' w='100' h='100' touchClass='image' onClick={this.onImageClick.bind(this, 'test param')} onLangPress={this.onImageLangPress.bind(this, 'test lang press')} />
					<CLabel>Test</CLabel>
					<CBetween touchClass='image' h='50' bg='#f60' onClick={this.onImageClick.bind(this, 'test param')} onLangPress={this.onImageLangPress.bind(this, 'test lang press')}>
						<CRow h='50' bg='#999' class='f02'></CRow>
						<CRow h='50' bg='#666' class='f02'></CRow>
					</CBetween>
				</CContent>
			</CPage>
		)
	}
}


